from flask import Blueprint, jsonify

from applications.models import Classify
from applications.schemas import ClassifySchema

bp = Blueprint('classify', __name__, url_prefix='/classify')

@bp.get('/')
def classify():
    data = Classify.query.order_by(Classify.sort).all()
    res = {
        "data": ClassifySchema(many=True).dump(data)
    }
    return jsonify(res)


